﻿/****************************************************************************************************
 ** Name:        Populate_Severity
 ** Description: Populates the dbo.Severity table.
 ****************************************************************************************************
 ** Revisions
 **  Date        Author               Work Item  Description
 **  ----------  -------------------  ---------  ----------------------------------------------------
 **  11/30/2008  Chad Green             11774    Initial Development
 ****************************************************************************************************/

-- 1 : Critical
IF EXISTS (SELECT * FROM dbo.Severity WHERE ID = 1)
	BEGIN
		UPDATE dbo.Severity SET Description = 'Critical', SortOrder = 1, IsActive = 1 WHERE ID = 1
	END
ELSE
	BEGIN
		INSERT INTO dbo.Severity (ID, Description, SortOrder, IsActive) VALUES (1, 'Critical', 1, 1)
	END

-- 2 : Warning
IF EXISTS (SELECT * FROM dbo.Severity WHERE ID = 2)
	BEGIN
		UPDATE dbo.Severity SET Description = 'Warning', SortOrder = 2, IsActive = 1 WHERE ID = 2
	END
ELSE
	BEGIN
		INSERT INTO dbo.Severity (ID, Description, SortOrder, IsActive) VALUES (2, 'Warning', 2, 1)
	END

-- 3 : Validation
IF EXISTS (SELECT * FROM dbo.Severity WHERE ID = 3)
	BEGIN
		UPDATE dbo.Severity SET Description = 'Validation', SortOrder = 3, IsActive = 1 WHERE ID = 3
	END
ELSE
	BEGIN
		INSERT INTO dbo.Severity (ID, Description, SortOrder, IsActive) VALUES (3, 'Validation', 3, 1)
	END

-- 4 : Information
IF EXISTS (SELECT * FROM dbo.Severity WHERE ID = 4)
	BEGIN
		UPDATE dbo.Severity SET Description = 'Information', SortOrder = 4, IsActive = 1 WHERE ID = 4
	END
ELSE
	BEGIN
		INSERT INTO dbo.Severity (ID, Description, SortOrder, IsActive) VALUES (4, 'Information', 4, 1)
	END